package com.lsy.seckill.RabbitMQ;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
public class SeckillSender {
    @Resource
    private RabbitTemplate rabbitTemplate;
    public void sendSeckillMessage(String message){
        log.info("发送的消息："+message);
        rabbitTemplate.convertAndSend("exchange","seckill.message",message);
    }
}
